[SERVER]
11.11.11.11

[DOWNLOAD]
lammps/2021.2.21 https://download.lammps.org/tars/lammps-10Feb2021.tar.gz

[DEPENDENCY]
module use ./software/modulefiles
module purge
./jarvis -install kgcc/10.3.1 com
module add bisheng/10.3.1
export CC=gcc CXX=g++ FC=gfortran
./jarvis -install hmpi/1.2.0 gcc
export CC=mpicc CXX=mpic++ FC=mpif90
./jarvis -install fftw/3.3.10 gcc+mpi

[ENV]
module purge
module use ${JARVIS_ROOT}/software/modulefiles
module add kgcc/10.3.1
module add hmpi/1.2.0
module add fftw/3.3.10
export CC=mpicc CXX=mpic++ FC=mpif90
# 源码目录
export SRC_DIR=${JARVIS_ROOT}/workloads/lammps/10Feb21/src/gcc
# 算例目录
export CASE_DIR=${JARVIS_ROOT}/workloads/lammps/10Feb21/case
# 二进制目录
export BIN_DIR=${SRC_DIR}/lammps-10Feb21/src
export BISHENG_HOME=${BISHENG_PATH}
export FFTW_HOME=${FFTW_PATH}
export DEVICE="mlx5_0:1"

[APP]
app_name = lammps
build_dir = 
binary_dir = 
case_dir = ${CASE_DIR}

[BUILD]
# 创建源码目录
mkdir -p ${SRC_DIR}
# 创建算例目录
mkdir -p ${CASE_DIR}
cd ${SRC_DIR}
rm -rf lammps-10Feb21
tar -zxvf ${JARVIS_ROOT}/downloads/lammps-10Feb2021.tar.gz -C .
cd lammps-10Feb21/src
make clean-all
sed -i '10c\CCFLAGS = -g -O3 -I${BISHENG_HOME}/include/c++/9.3.1 -L${BISHENG_HOME}/lib -std=c++11 '   MAKE/Makefile.mpi
sed -i '15c\LINKFLAGS =  -g -O -L${BISHENG_HOME}/lib -std=c++11 '   MAKE/Makefile.mpi
sed -i '53c\FFT_INC = -DFFT_FFTW -I${FFTW_HOME}/include ' MAKE/Makefile.mpi
sed -i '54c\FFT_PATH = -L${FFTW_HOME}/lib'  MAKE/Makefile.mpi
sed -i '55c\FFT_LIB = -lfftw3' MAKE/Makefile.mpi
make yes-KSPACE
make yes-MPIIO
make yes-MOLECULE
make yes-MANYBODY
make yes-USER-REAXC
make -j10 mpi
cp ${SRC_DIR}/lammps-10Feb21/bench/in.lj ${CASE_DIR}
sed -i '30c\run             100000' ${CASE_DIR}/in.lj

[RUN]
run = cd ${CASE_DIR}  && mpirun --allow-run-as-root -np 128 -bind-to core -x OMP_NUM_THREADS=1 -x UCX_NET_DEVICES=${DEVICE} -mca pml ucx -mca btl ^vader,tcp,openib,uct -x UCX_TLS=sm -map-by ppr:16:numa:pe=1  ${BIN_DIR}/lmp_mpi -in in.lj
binary =
nodes = 1

[JOB]
#!/bin/sh
#DSUB -n lammps
#DSUB --job_type cosched:hmpi
#DSUB -A root.default
#DSUB -q root.default
#DSUB -N 1
#DSUB -R cpu=128
#DSUB -oo lammps-%J.out
#DSUB -eo lammps-%J.err

##set runtime environment variables

ulimit -s unlimited
ulimit -c unlimited
rm -rf rsl.*
echo "----HOSTFILE generated---"
cat $CCS_HOST_FILE
echo "-------------------------"
EXEC_CMD="time -p mpirun $CCS_MPI_OPTIONS -N 128 -x OMP_NUM_THREADS=1 -x UCX_NET_DEVICES=${DEVICE} -mca pml ucx -mca btl ^vader,tcp,openib,uct -x UCX_TLS=self,sm,rc -bind-to core -x PATH -x LD_LIBRARY_PATH ${BIN_DIR}/lmp_mpi -in in.lj"
echo "$EXEC_CMD"
date
$EXEC_CMD
date